package com.cyt.work.antiepidemic.model.po;

import com.cyt.base.util.BaseUtil;
import com.cyt.base.util.DictCode;
import com.cyt.sys.model.po.SysUser;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;

/**
 * e门通-社区出入信息实体类
 *
 * @author rong yuan
 * @date 2020-2-12 2:24:25
 */
@Data
@NoArgsConstructor
@Table(name = "cyt_antiepidemic_record")
public class AntiepidemicRecord implements Serializable {

    /**
     * 主键ID
     */
    @Id
    private String id;

    /**
     * 应用ID
     */
    @Column(name = "apply_id")
    private String applyId;

    /**
     * 住户ID
     */
    @Column(name = "person_id")
    private String personId;

    /**
     * 出入类型：0-临时出入；1-上班出入
     */
    @Column(name = "access_type")
    private String accessType;

    /**
     * 出门时间
     */
    @Column(name = "begin_time")
    private Date beginTime;

    /**
     * 进门时间
     */
    @Column(name = "end_time")
    private Date endTime;

    /**
     * 出行状态：0-未返回；1-按时返回；2-超时返回；3-提前返回
     */
    @Column(name = "access_status")
    private String accessStatus;

    /**
     * 删除标志：0-未删除；1-已删除
     */
    @Column(name = "remove_tag")
    private String removeTag;

    /**
     * 创建人ID
     */
    @Column(name = "create_user")
    private String createUser;

    /**
     * 创建时间
     */
    @Column(name = "create_time")
    private Date createTime;

    /**
     * 更新人ID
     */
    @Column(name = "update_user")
    private String updateUser;

    /**
     * 更新时间
     */
    @Column(name = "update_time")
    private Date updateTime;

    /**
     * 创建对象
     *
     * @param sysUser 当前用户信息
     * @author rong yuan
     * @date 2020-2-12 2:24:25
     */
    public AntiepidemicRecord(SysUser sysUser) {
        this.id = BaseUtil.uId();
        this.removeTag = DictCode.BASE_REMOVE_TAG_NORMAL;
        this.createTime = new Date();
        this.updateTime = new Date();
        if (sysUser != null) {
            this.createUser = sysUser.getId();
            this.updateUser = sysUser.getId();
        }
    }
}